package lee.vioson.remotedata.database

import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import lee.vioson.remotedata.bean.Book
import lee.vioson.remotedata.dao.BookDao

/**
 *Author:viosonlee
 *Date:2023/6/18
 *DESCRIPTION:
 */
val Context.db: AppDataBase
    get() = Room.databaseBuilder(
        this,
        AppDataBase::class.java,
        "ebook-data-base"
    ).build()


@Database(entities = [Book::class], version = 1)
abstract class AppDataBase : RoomDatabase() {
    abstract fun bookDao(): BookDao
}